//
//  KKWebViewController.h
//  FreightAssistant
//
//  Created by Mac mini on 15/12/11.
//  Copyright © 2015年 leo. All rights reserved.
//

#import <UIKit/UIKit.h>

@class KKWebView;

@interface KKWebViewController : UIViewController

- (nullable instancetype)initWithRequestURL:(nonnull NSString *)requestURL;

@property (nonnull, nonatomic, copy) NSString *requestURL;

@property (nonnull, nonatomic, readonly) KKWebView *webView;

@end



@interface KKWebView : UIView

@property (nullable, nonatomic, strong) NSString *allowURLHost;       /**< 设定允许允许的IP地址 */


- (void)kk_loadURLString:(nonnull NSString *)urlString;

- (void)kk_loadRequest:(nonnull NSURLRequest *)request;

- (void)kk_loadHTMLString:(nonnull NSString *)string baseURL:(nullable NSURL *)baseURL;

- (void)kk_loadData:(nonnull NSData *)data MIMEType:(nonnull NSString *)MIMEType textEncodingName:(nonnull NSString *)textEncodingName baseURL:(nonnull NSURL *)baseURL;

/**
 *  加载JS代码
 *
 *  @param script 需要执行的JS代码
 *
 *  @return 返回结果
 */
- (nullable NSString *)stringByEvaluatingJavaScriptFromString:(nullable NSString *)script;

@end